home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / manageme / snmp-dev.000 / snmp-dev / context.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-19  |  2.6 KB  |  102 lines

  1. /*
  2.     contextIdentity         Context,
  3.     contextIndex            INTEGER,
  4.     contextViewIndex        INTEGER,
  5.     contextLocalEntity      OCTET STRING,
  6.     contextLocalTime        OBJECT IDENTIFIER,
  7.     contextDstPartyIndex    INTEGER,
  8.     contextSrcPartyIndex    INTEGER,
  9.     contextProxyContext     OBJECT IDENTIFIER
  10.     contextStorageType      StorageType,
  11.     contextStatus           RowStatus
  12.  */
  13.  
  14. #define CONTEXTIDENTITY         1
  15. #define CONTEXTINDEX            2
  16. #define CONTEXTLOCAL        3
  17. #define CONTEXTVIEWINDEX        4
  18. #define CONTEXTLOCALENTITY      5
  19. #define CONTEXTLOCALTIME        6
  20. #define CONTEXTDSTPARTYINDEX    7
  21. #define CONTEXTSRCPARTYINDEX    8
  22. #define CONTEXTPROXYCONTEXT     9
  23. #define CONTEXTSTORAGETYPE      10
  24. #define CONTEXTSTATUS           11
  25.  
  26. #define CONTEXTNONEXISTENT     0
  27. #define CONTEXTACTIVE        1
  28. #define CONTEXTNOTINSERVICE    2
  29. #define CONTEXTNOTREADY        3
  30. #define CONTEXTCREATEANDGO    4
  31. #define CONTEXTCREATEANDWAIT    5
  32. #define CONTEXTDESTROY        6
  33.  
  34.  
  35. #define CURRENTTIME    1
  36. #define RESTARTTIME    2
  37. #define CACHETIME    3    /* not implemented */
  38.  
  39. struct contextEntry {
  40.     oid        contextIdentity[32];
  41.     int        contextIdentityLen;
  42.     int        contextIndex;
  43.     char    contextName[64];    /* friendly name */
  44.     int        contextLocal;
  45.     int        contextViewIndex;
  46.     u_char    contextLocalEntity[64];
  47.     int        contextLocalEntityLen;
  48.     int        contextLocalTime;
  49.     int        contextDstPartyIndex;
  50.     int        contextSrcPartyIndex;
  51.     oid        contextProxyContext[32];
  52.     int        contextProxyContextLen;
  53.     int        contextStorageType;
  54.     int        contextStatus;
  55.     
  56.     u_long    contextBitMask;
  57.  
  58.     struct contextEntry *reserved;
  59.     struct contextEntry *next;
  60.     struct timeval tv;
  61. };
  62.  
  63. u_char *var_context();
  64. int write_context();
  65.  
  66. struct contextEntry *
  67. context_getEntry(/* oid *contextID, int contextIDLen */);
  68. /*
  69.  * Returns a pointer to the contextEntry with the
  70.  * same identity as contextID.
  71.  * Returns NULL if that entry does not exist.
  72.  */
  73.  
  74. void context_scanInit();
  75. /*
  76.  * Initialized the scan routines so that they will begin at the
  77.  * beginning of the list of contextEntries.
  78.  *
  79.  */
  80.  
  81.  
  82. struct contextEntry *
  83. context_scanNext();
  84. /*
  85.  * Returns a pointer to the next contextEntry.
  86.  * These entries are returned in no particular order,
  87.  * but if N entries exist, N calls to context_scanNext() will
  88.  * return all N entries once.
  89.  * Returns NULL if all entries have been returned.
  90.  * context_scanInit() starts the scan over.
  91.  */
  92.  
  93. struct contextEntry *
  94. context_createEntry(/* oid *contextID, int contextIDLen */);
  95. /*
  96.  * Creates a contextEntry with the given index
  97.  * and returns a pointer to it.
  98.  * The status of this entry is created as invalid.
  99.  */
  100.  
  101. extern void context_destroyEntry ();
  102.